/* 全局样式 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: var(--vscode-foreground);
  background-color: var(--vscode-sideBar-background);
}

/* 应用主容器 */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 紧凑型头部样式 */
.compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 2px solid var(--vscode-sideBar-border);
  background-color: var(--vscode-sideBarSectionHeader-background);
  min-height: 36px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--vscode-sideBarSectionHeader-foreground);
}

.header-divider {
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
}

.conversation-status {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  font-style: italic;
}


.header-right {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}

.header-action-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  color: var(--vscode-icon-foreground);
  font-size: 12px;
  transition: background-color 0.2s;
}

.header-action-button:hover {
  background-color: var(--vscode-toolbar-hoverBackground);
}

/* 废弃的头部样式已移除，使用CompactHeader组件 */

.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* 聊天窗口 */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--vscode-descriptionForeground);
  height: 100%;
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  max-width: 300px;
}

/* 对话项 */
.conversation-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 气泡式消息样式 */
.message-container {
  display: flex;
  width: 100%;
  margin-bottom: 4px;
}

.message-container.user {
  justify-content: flex-end;
}

.message-container.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 16px;
  position: relative;
  word-wrap: break-word;
}

.message-container.user .message-bubble {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border-bottom-right-radius: 4px;
}

.message-container.assistant .message-bubble {
  background-color: var(--vscode-editorWidget-background);
  color: var(--vscode-foreground);
  border: 1px solid var(--vscode-widget-border);
  border-bottom-left-radius: 4px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
  opacity: 0.8;
}

.message-meta.user-meta {
  justify-content: flex-end;
  margin-bottom: 0;
  margin-top: 4px;
}

.operation-badge {
  background-color: var(--vscode-badge-background);
  color: var(--vscode-badge-foreground);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 500;
}

.timestamp {
  color: var(--vscode-descriptionForeground);
  font-size: 9px;
}

/* 用户消息时间戳特殊样式 - 在蓝色背景上更清晰 */
.message-container.user .timestamp {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.message-content {
  font-size: 13px;
  line-height: 1.4;
}

.user-text {
  color: inherit;
}

.assistant-text {
  color: inherit;
}

/* 结果卡片 */
.result-card {
  margin-top: 8px;
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 6px;
  overflow: hidden;
}

.result-card.empty {
  padding: 12px;
  text-align: center;
  color: var(--vscode-descriptionForeground);
  background-color: var(--vscode-editor-background);
}

/* 结果消息样式 */
.result-message {
  padding: 12px;
  background-color: var(--vscode-editor-background);
  border-radius: 4px;
}

.result-message p {
  margin: 0 0 8px 0;
  color: var(--vscode-foreground);
  font-size: 13px;
  line-height: 1.4;
}

.language-info {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  margin-top: 8px;
}

/* 无修改结果样式 */
.result-message.no-changes {
  text-align: center;
  padding: 20px 12px;
}

.success-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.result-message.no-changes p {
  font-size: 14px;
  font-weight: 500;
  color: var(--vscode-foreground);
  margin-bottom: 4px;
}

.result-message.no-changes .description {
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  margin-top: 4px;
}

.results-header {
  padding: 8px 12px;
  background-color: var(--vscode-sideBarSectionHeader-background);
  color: var(--vscode-sideBarSectionHeader-foreground);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.result-item {
  border-bottom: 1px solid var(--vscode-sideBar-border);
  background-color: var(--vscode-editor-background);
}

.result-item:last-child {
  border-bottom: none;
}

/* 旧的结果展示样式已移除，使用UnifiedResultSection组件样式 */

/* 输入面板 */
.input-panel {
  border-top: 2px solid var(--vscode-sideBar-border);
  background-color: var(--vscode-sideBar-background);
  padding: 10px 12px;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.text-input-section {
  margin-bottom: 12px;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.selected-indicator {
  font-size: 10px;
  color: var(--vscode-textLink-foreground);
  font-weight: normal;
}

.text-input {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}

.text-input:focus {
  outline: none;
  border-color: var(--vscode-focusBorder);
}

.selected-text-display {
  position: relative;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  padding: 8px;
}

.selected-text-content {
  font-size: 12px;
  color: var(--vscode-input-foreground);
  line-height: 1.4;
  margin-bottom: 8px;
  max-height: 100px;
  overflow-y: auto;
}

.clear-selection {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  color: var(--vscode-icon-foreground);
  font-size: 10px;
}

.clear-selection:hover {
  background-color: var(--vscode-toolbar-hoverBackground);
}

/* 旧的操作按钮样式已移除，使用新的紧凑型工具栏 */

.action-button {
  padding: 8px 12px;
  border: 1px solid var(--vscode-button-border);
  border-radius: 4px;
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s;
  white-space: nowrap;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.action-button:hover:not(:disabled) {
  background-color: var(--vscode-button-hoverBackground);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.language-select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 12px;
  min-width: 120px;
  height: 32px;
}

/* 选中文本引用样式 */
.selected-text-reference {
  margin-bottom: 12px;
  padding: 8px;
  background-color: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 4px;
  border-left: 3px solid var(--vscode-button-background);
}

.reference-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--vscode-descriptionForeground);
  margin-bottom: 4px;
}

.reference-content {
  font-size: 12px;
  color: var(--vscode-foreground);
  font-style: italic;
  cursor: help;
}

/* 统一输入框样式 */
.unified-input-section {
  margin-bottom: 10px;
}

/* 紧凑型操作工具栏 */
.action-toolbar {
  margin-top: 8px;
}

.action-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-action-button {
  padding: 6px 10px;
  border: 1px solid var(--vscode-button-border);
  border-radius: 4px;
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.2s;
  white-space: nowrap;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.compact-action-button:hover:not(:disabled) {
  background-color: var(--vscode-button-hoverBackground);
}

.compact-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.translate-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inline-language-select {
  padding: 4px 6px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 10px;
  min-width: 50px;
  height: 28px;
}

.inline-language-select:focus {
  outline: 1px solid var(--vscode-focusBorder);
  outline-offset: -1px;
}

.input-container {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.unified-input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 12px;
  font-family: var(--vscode-font-family);
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

.unified-input:focus {
  outline: 1px solid var(--vscode-focusBorder);
  outline-offset: -1px;
}

.submit-button {
  padding: 8px 12px;
  border: 1px solid var(--vscode-button-border);
  border-radius: 4px;
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  height: fit-content;
  min-height: 32px;
  transition: background-color 0.2s;
}

.submit-button:hover:not(:disabled) {
  background-color: var(--vscode-button-hoverBackground);
}

.submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rewrite-input::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

.rewrite-send-button {
  padding: 4px 12px;
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background-color 0.15s ease;
}

.rewrite-send-button:hover:not(:disabled) {
  background-color: var(--vscode-button-hoverBackground);
}

.rewrite-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.language-select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 11px;
}

.translate-button {
  flex: 2;
}

/* 提示信息样式已移除，通过上下文提供信息 */

/* 统一结果展示组件样式 */
.unified-result-section {
  margin-top: 8px;
  border: 1px solid var(--vscode-panel-border);
  border-radius: 4px;
  overflow: hidden;
}

.section-header {
  padding: 8px 12px;
  background-color: var(--vscode-editorGroupHeader-tabsBackground);
  border-bottom: 1px solid var(--vscode-panel-border);
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.items-list {
  background-color: var(--vscode-editor-background);
}

.result-item {
  border-bottom: 1px solid var(--vscode-panel-border);
}

.result-item:last-child {
  border-bottom: none;
}

.item-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.item-summary:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.item-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.item-title {
  flex: 1;
  font-size: 12px;
  color: var(--vscode-foreground);
  line-height: 1.3;
}

.expand-icon {
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
  width: 12px;
  text-align: center;
}

.item-details {
  padding: 8px 12px 12px 36px;
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.4;
  background-color: var(--vscode-editorWidget-background);
  border-top: 1px solid var(--vscode-panel-border);
}

/* 检查结果特定样式 */
.check-item.error .item-summary {
  border-left: 3px solid var(--vscode-errorForeground);
}

.check-item.warning .item-summary {
  border-left: 3px solid var(--vscode-warningForeground);
}

.check-item.info .item-summary {
  border-left: 3px solid var(--vscode-infoForeground);
}

/* 加载动画 */
.loading-spinner {
  padding: 16px;
  text-align: center;
  background-color: var(--vscode-editor-background);
  border-top: 1px solid var(--vscode-sideBar-border);
}

.spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--vscode-progressBar-background);
  border-top: 2px solid var(--vscode-progressBar-foreground);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-message {
  font-size: 12px;
  color: var(--vscode-foreground);
  white-space: nowrap;
}

.cancel-button {
  background: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.cancel-button:hover {
  background: var(--vscode-button-secondaryHoverBackground);
}

/* 错误消息 */
.error-message {
  padding: 8px 12px;
  background-color: var(--vscode-inputValidation-errorBackground);
  border: 1px solid var(--vscode-inputValidation-errorBorder);
  border-radius: 4px;
  margin: 8px 12px;
}

.error-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.error-icon {
  color: var(--vscode-errorForeground);
  flex-shrink: 0;
}

.error-text {
  flex: 1;
  color: var(--vscode-inputValidation-errorForeground);
}

.error-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--vscode-icon-foreground);
  font-size: 14px;
  line-height: 1;
}

.error-dismiss:hover {
  color: var(--vscode-errorForeground);
}

/* 错误类型特定样式 */
.error-message.network-error {
  background-color: var(--vscode-editorInfo-background);
  border-color: var(--vscode-editorInfo-border);
}

.error-message.config-error {
  background-color: var(--vscode-editorWarning-background);
  border-color: var(--vscode-editorWarning-border);
}

.error-message.user-error {
  background-color: var(--vscode-editorHint-background);
  border-color: var(--vscode-editorHint-border);
}

.error-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.error-suggestion {
  font-size: 11px;
  opacity: 0.8;
  font-style: italic;
  color: var(--vscode-descriptionForeground);
}

/* ===== Diff View 样式 ===== */
.diff-view {
  border: 1px solid var(--vscode-panel-border);
  border-radius: 6px;
  margin: 8px 0;
  background-color: var(--vscode-editor-background);
  overflow: hidden;
}

.diff-view.no-changes {
  border-color: var(--vscode-textBlockQuote-border);
  background-color: var(--vscode-textBlockQuote-background);
}

.diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--vscode-editorGroupHeader-tabsBackground);
  border-bottom: 1px solid var(--vscode-panel-border);
}

.diff-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diff-title h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--vscode-icon-foreground);
  font-size: 10px;
  line-height: 1;
}

.expand-toggle:hover {
  background-color: var(--vscode-toolbar-hoverBackground);
  border-radius: 2px;
}

.diff-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

.stat-insertions {
  color: var(--vscode-gitDecoration-addedResourceForeground);
  font-weight: 500;
}

.stat-deletions {
  color: var(--vscode-gitDecoration-deletedResourceForeground);
  font-weight: 500;
}

.stat-total {
  color: var(--vscode-descriptionForeground);
}

.no-changes-text {
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
  font-style: italic;
}

.diff-content {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.diff-text {
  font-family: var(--vscode-editor-font-family);
  font-size: var(--vscode-editor-font-size);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-segment {
  position: relative;
}

.diff-insert {
  background-color: var(--vscode-diffEditor-insertedTextBackground);
  color: var(
    --vscode-diffEditor-insertedTextForeground,
    var(--vscode-foreground)
  );
  border-radius: 2px;
  padding: 1px 2px;
}

.diff-delete {
  background-color: var(--vscode-diffEditor-removedTextBackground);
  color: var(
    --vscode-diffEditor-removedTextForeground,
    var(--vscode-foreground)
  );
  text-decoration: line-through;
  border-radius: 2px;
  padding: 1px 2px;
}

.diff-equal {
  /* 保持默认样式 */
}

.diff-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--vscode-editorWidget-background);
  border-top: 1px solid var(--vscode-panel-border);
}

.btn {
  padding: 6px 12px;
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-accept {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

.btn-accept:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.btn-reject {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
}

.btn-reject:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.processing {
  opacity: 0.8;
  cursor: wait;
}

/* ===== Issues Section 样式 ===== */
.issues-section {
  margin-top: 12px;
  padding: 12px;
  background-color: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 4px;
}

.issues-section h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.issues-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--vscode-panel-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.issue-item:last-child {
  border-bottom: none;
}

.issue-message {
  font-size: 12px;
  color: var(--vscode-foreground);
  font-weight: 500;
}

.issue-suggestion {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  font-style: italic;
}

/* ChatView组件样式已移除，该组件已废弃 */

/* ChatView特有的消息样式已移除，使用新的气泡式Message组件样式 */


/* 修改说明样式 - 紧凑版 */
.changes-section {
  margin-top: 8px;
  padding: 10px;
  background-color: var(--vscode-editor-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 4px;
}

.changes-section h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--vscode-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.changes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.change-item {
  padding: 8px 10px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.change-item:hover {
  border-color: var(--vscode-focusBorder);
}

.change-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.change-type {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.change-type-structure {
  background-color: rgba(0, 122, 255, 0.1);
  color: #007acc;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

.change-type-clarity {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ff8c00;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.change-type-conciseness {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.change-type-grammar {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.change-type-tone {
  background-color: rgba(102, 16, 242, 0.1);
  color: #6610f2;
  border: 1px solid rgba(102, 16, 242, 0.2);
}

.change-type-style {
  background-color: rgba(214, 51, 132, 0.1);
  color: #d63384;
  border: 1px solid rgba(214, 51, 132, 0.2);
}

.change-description {
  font-size: 12px;
  color: var(--vscode-foreground);
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
}

.change-reason {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.3;
  font-style: italic;
  padding-left: 12px;
  margin-top: 2px;
  border-left: 2px solid var(--vscode-panel-border);
}

/* 配置提供者样式 */
.config-provider {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.config-header {
  text-align: center;
  margin-bottom: 30px;
}

.config-header h2 {
  color: var(--vscode-foreground);
  margin-bottom: 10px;
}

.config-header p {
  color: var(--vscode-descriptionForeground);
  font-size: 14px;
}

.config-form {
  background: var(--vscode-editor-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--vscode-foreground);
  font-weight: 500;
}

/* 高级配置样式 */
.advanced-config {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--vscode-panel-border);
}

.advanced-config h3 {
  color: var(--vscode-foreground);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--vscode-focusBorder);
}

.form-group input.error {
  border-color: var(--vscode-errorForeground);
}

.api-key-input {
  position: relative;
  display: flex;
  align-items: center;
}

.api-key-input input {
  flex: 1;
  padding-right: 40px;
}

.toggle-visibility {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--vscode-descriptionForeground);
  font-size: 16px;
}

.toggle-visibility:hover {
  color: var(--vscode-foreground);
}



.help-text {
  display: block;
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.test-button,
.save-button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.test-button {
  background: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
}

.test-button:hover {
  background: var(--vscode-button-secondaryHoverBackground);
}

.save-button {
  background: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

.save-button:hover {
  background: var(--vscode-button-hoverBackground);
}

.test-button:disabled,
.save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 保存状态指示器 */
.save-status {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-status.saving {
  background: var(--vscode-editorInfo-background);
  border: 1px solid var(--vscode-editorInfo-border);
  color: var(--vscode-editorInfo-foreground);
}

.save-status.saved {
  background: var(--vscode-editorGutter-addedBackground);
  border: 1px solid var(--vscode-gitDecoration-addedResourceForeground);
  color: var(--vscode-gitDecoration-addedResourceForeground);
}

.save-status.error {
  background: var(--vscode-editorError-background);
  border: 1px solid var(--vscode-editorError-border);
  color: var(--vscode-editorError-foreground);
}

.save-status.unsaved {
  background: var(--vscode-editorWarning-background);
  border: 1px solid var(--vscode-editorWarning-border);
  color: var(--vscode-editorWarning-foreground);
}

/* 配置建议区域样式 */
.config-advice {
  margin: 20px 0;
  border: 1px solid var(--vscode-widget-border);
  border-radius: 6px;
  overflow: hidden;
}

.advice-toggle {
  width: 100%;
  padding: 12px 16px;
  background: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.advice-toggle:hover {
  background: var(--vscode-button-secondaryHoverBackground);
}

.advice-content {
  padding: 16px;
  background: var(--vscode-editor-background);
  border-top: 1px solid var(--vscode-widget-border);
}

.advice-section {
  margin-bottom: 20px;
}

.advice-section:last-child {
  margin-bottom: 0;
}

.advice-section h4 {
  margin: 0 0 12px 0;
  color: var(--vscode-foreground);
  font-size: 14px;
  font-weight: 600;
}

.advice-item {
  margin-bottom: 12px;
}

.advice-item:last-child {
  margin-bottom: 0;
}

.advice-item strong {
  color: var(--vscode-foreground);
  font-weight: 600;
}

.advice-item ul {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.advice-item li {
  margin-bottom: 4px;
  color: var(--vscode-foreground);
  font-size: 13px;
  line-height: 1.4;
}

.advice-item code {
  background: var(--vscode-textCodeBlock-background);
  color: var(--vscode-textPreformat-foreground);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--vscode-editor-font-family);
  font-size: 12px;
}

.advice-item p {
  margin: 8px 0 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--vscode-descriptionForeground);
}

/* 改进的diff显示样式 - 移除内部边框 */
.diff-section {
  margin-bottom: 16px;
  overflow: hidden;
}

.diff-section-header {
  background: var(--vscode-editor-background);
  padding: 8px 12px;
  font-weight: 500;
  border-top: 2px solid var(--vscode-panel-border);
}

.diff-section-title {
  color: var(--vscode-foreground);
  font-size: 14px;
}

.original-section .diff-section-header {
  background: var(--vscode-diffEditor-removedTextBackground);
  border-top-color: var(--vscode-diffEditor-removedTextBackground);
}

.modified-section .diff-section-header {
  background: var(--vscode-diffEditor-insertedTextBackground);
  border-top-color: var(--vscode-diffEditor-insertedTextBackground);
}

.diff-text {
  padding: 12px;
  line-height: 1.6;
  font-family: var(--vscode-editor-font-family);
  font-size: var(--vscode-editor-font-size);
  background: var(--vscode-editor-background);
  border-left: 2px solid var(--vscode-panel-border);
  border-right: 2px solid var(--vscode-panel-border);
  border-bottom: 2px solid var(--vscode-panel-border);
}

.original-section .diff-text {
  border-left-color: var(--vscode-diffEditor-removedTextBackground);
  border-right-color: var(--vscode-diffEditor-removedTextBackground);
  border-bottom-color: var(--vscode-diffEditor-removedTextBackground);
}

.modified-section .diff-text {
  border-left-color: var(--vscode-diffEditor-insertedTextBackground);
  border-right-color: var(--vscode-diffEditor-insertedTextBackground);
  border-bottom-color: var(--vscode-diffEditor-insertedTextBackground);
}

.diff-segment.deleted {
  background: var(--vscode-diffEditor-removedTextBackground);
  color: var(--vscode-diffEditor-removedTextForeground);
  text-decoration: line-through;
  padding: 2px 4px;
  border-radius: 3px;
  margin: 0 1px;
}

.diff-segment.inserted {
  background: var(--vscode-diffEditor-insertedTextBackground);
  color: var(--vscode-diffEditor-insertedTextForeground);
  padding: 2px 4px;
  border-radius: 3px;
  margin: 0 1px;
}

.diff-segment.unchanged {
  color: var(--vscode-foreground);
}

/* 配置检查样式 */
.config-checking {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--vscode-descriptionForeground);
}

/* ===== 检查规则管理器样式 ===== */
.check-rules-manager {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--vscode-sideBar-background);
}

.check-rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--vscode-editorGroupHeader-tabsBackground);
  border-bottom: 1px solid var(--vscode-panel-border);
}

.check-rules-header h2 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.rules-description {
  margin: 0;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.4;
  max-width: 400px;
}

.back-button {
  background: none;
  border: none;
  color: var(--vscode-foreground);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.back-button:hover {
  background-color: var(--vscode-toolbar-hoverBackground);
}

.create-rule-button {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.create-rule-button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.check-rules-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.rule-type-section {
  margin-bottom: 24px;
}

.rule-type-section:last-child {
  margin-bottom: 0;
}

.rule-type-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--vscode-foreground);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--vscode-panel-border);
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-item {
  display: flex;
  background-color: var(--vscode-editor-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 6px;
  padding: 12px;
  gap: 12px;
}

.rule-item.default-rule {
  border-left: 4px solid var(--vscode-badge-background);
}

.rule-item.custom-rule {
  border-left: 4px solid var(--vscode-button-background);
}

.rule-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--vscode-foreground);
}

.default-badge {
  background-color: var(--vscode-badge-background);
  color: var(--vscode-badge-foreground);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

.rule-description {
  margin: 0;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.4;
}

.rule-content-preview {
  font-size: 11px;
  color: var(--vscode-foreground);
  line-height: 1.3;
}

.rule-content-preview strong {
  color: var(--vscode-foreground);
}

.rule-content-preview span {
  color: var(--vscode-descriptionForeground);
}

.rule-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--vscode-button-secondaryBackground);
  transition: .4s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--vscode-button-background);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.rule-actions {
  display: flex;
  gap: 6px;
}

.view-button,
.edit-button,
.delete-button {
  background: none;
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-button {
  color: var(--vscode-foreground);
  background-color: var(--vscode-button-secondaryBackground);
}

.edit-button {
  color: var(--vscode-button-foreground);
  background-color: var(--vscode-button-background);
}

.delete-button {
  color: var(--vscode-errorForeground);
  background-color: transparent;
  border-color: var(--vscode-errorForeground);
}

.view-button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.edit-button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.delete-button:hover {
  background-color: var(--vscode-errorForeground);
  color: white;
}

.unsaved-changes-bar {
  position: sticky;
  bottom: 0;
  background-color: var(--vscode-editorWarning-background);
  border-top: 1px solid var(--vscode-editorWarning-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--vscode-editorWarning-foreground);
  font-size: 12px;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.reset-button,
.save-button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid;
  transition: background-color 0.2s;
}

.reset-button {
  background-color: transparent;
  color: var(--vscode-editorWarning-foreground);
  border-color: var(--vscode-editorWarning-foreground);
}

.reset-button:hover {
  background-color: var(--vscode-editorWarning-foreground);
  color: white;
}

.save-button {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border-color: var(--vscode-button-border);
}

.save-button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--vscode-editor-background);
  border: 1px solid var(--vscode-panel-border);
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--vscode-panel-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.close-button {
  background: none;
  border: none;
  color: var(--vscode-foreground);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.close-button:hover {
  background-color: var(--vscode-toolbar-hoverBackground);
}

.rule-form {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--vscode-foreground);
  font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  font-size: 13px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--vscode-focusBorder);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--vscode-foreground);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-button {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cancel-button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}
